home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / EGAVGA.SWG / 0147_Rainbow Credits Scroll.pas < prev    next >
Pascal/Delphi Source File  |  1995-03-03  |  2KB  |  67 lines

  1. {
  2. Here's an example of one of the possibilities mode-q offers. Of course the same
  3. can be done in any other mode, too... Well, just check it out. To Jens and the
  4. other carefull ones: keep being carefull (read the text).
  5. }
  6. {$define cpu386}
  7.  
  8. program creditscroll;
  9. { Made by Bas van Gaalen, Holland, PD }
  10. uses
  11.   crt,umodeq;
  12. const
  13.   vseg:word=$a000; fseg=$f000; fofs=$fa6e; lines=45;
  14.   txt:array[0..lines-1] of string[30]=(
  15.    {.........|.........|.........|}
  16.     'This is a credits-scroll',
  17.     'in mode-q: 256x256x256.',
  18.     'That''s a chained mode, with',
  19.     'a lineair addressing sceme.',
  20.     'The graphics-screen is',
  21.     'initialized in the unit',
  22.     'umodeq. It''s enclosed in the',
  23.     'next message (I hope).','','',
  24.     'and so the credits go to','','',
  25.     '...Bas van Gaalen...','','',
  26.     'Btw: this is quite lame:',
  27.     'not even a hardware-scroll!',
  28.     'But it''s just to show the',
  29.     'nice overscan-mode...','',
  30.     'Uuuhm, can someone supply',
  31.     'some shit, to fill up this',
  32.     'text?','',
  33.     'Oyeah, before I forget,',
  34.     'mode-q is a tweaked mode,',
  35.     'and it plays a bit with the',
  36.     'VGA-registers!',
  37.     'So again: I won''t take any',
  38.     'responsebilty for this code!',
  39.     'It works fine on my ET-4000.','','','',
  40.     'Gayle, place this in the SWAG',
  41.     'if you like...','','','','','','','','');
  42.  
  43. procedure retrace; assembler; asm
  44.   mov dx,3dah; @vert1: in al,dx; test al,8; jz @vert1
  45.   @vert2: in al,dx; test al,8; jnz @vert2; end;
  46.  
  47. procedure moveup; assembler; asm
  48.   push ds; mov es,vseg; mov ds,vseg; xor di,di; mov si,0100h
  49.   {$ifdef cpu386} mov cx,255*256/4; db $66; rep movsw
  50.   {$else} mov cx,255*256/2; rep movsw {$endif} pop ds; end;
  51.  
  52. var i,j,slidx,txtidx:byte;
  53. begin
  54.   setmodeq;
  55.   txtidx:=0; slidx:=0;
  56.   repeat
  57.     retrace;
  58.     for i:=1 to length(txt[txtidx]) do for j:=0 to 7 do
  59.       if ((mem[fseg:fofs+ord(txt[txtidx][i])*8+slidx] shl j) and 128)<>0 then
  60.         mem[vseg:$fe00+i*8+(256-8*length(txt[txtidx])) div
  61. 2+j]:=32+txtidx+slidx+j;    moveup;
  62.     slidx:=(1+slidx) mod 8;
  63.     if slidx=0 then txtidx:=(1+txtidx) mod lines;
  64.   until keypressed;
  65.   inittxt;
  66. end.
  67.